/**
 * 
 * @brief  bsp.h
 * @param  None
 * 
 * @author xhq
 * @date   2024/11/05
 * 
 */
#ifndef __SRC_BSP_H__
#define __SRC_BSP_H__

/* include */
#include "typedef.h"
#include "global_variables.h"
#include "bsp_net.h"
#include "bsp_spi.h"
#include "bsp_mipi.h"
#include "bsp_gpio.h"
#include "userHandler.h"

/* define */
#define APP_BIN_CONFIG_APPSYS_CONF_NAME  "appsys.conf"
#define APP_BIN_CONFIG_APPSYS_BACKUP_CONF_NAME  "appsys_backup.conf"
#define APP_BIN_CONFIG_APPSYS_DEFAULT_CONF_NAME  "appsys_default.conf"

/* typedef */

/* global varibles */
extern uint8_t g_temp_mipi[MIPI_CHANNEL_MAX][MIPI_RECV_THREAD_NUM][FRAME_LEN];

/* private function */

/* function */
uint32_t bsp_init(void);
uint32_t create_semaphore();

uint32_t get_appsys_config(sys_config_type * sys_config);
uint32_t sys_config_init(sys_config_type * sys_config);

uint32_t get_app_absolute_path(void);
uint32_t get_app_file_absolute_path(const char * file_name, const uint32_t file_type, char * path, const ssize_t limit_len);

uint32_t save_data_to_ssd(uint8_t *buf, uint32_t len, uint32_t flag, uint32_t fram_count);
#endif